#include "Animations.h"


Animations::Animations(const AnimationData& _data, int _posX, int _posY, SDLScene* _scene)
	: SDLAnimation(_data.nbFrames, 4, _posX, _posY, _data.frameX, _data.frameY, _data.width, _data.height, false, _data.isHorizontal, "Image/Utilities.png", _scene)
{

}

Animations::Animations(const Pokemon& _pokemon, int _posX, int _posY, bool isPlayer, SDLScene* _scene)
	: SDLAnimation(1, 2, _posX, _posY, 0, POKEMON_HEIGHT * (_pokemon.GetNumber() - 1), POKEMON_WIDTH, POKEMON_HEIGHT, true, true, "Image/Pokemon_Battle.png", _scene)
{

}

Animations::Animations(const Pokemon& _pokemon, int _posX, int _posY, SDLScene* _scene)
	: SDLAnimation(2, 2, _posX, _posY, POKEMON_WIDTH, POKEMON_HEIGHT * (_pokemon.GetNumber() - 1), POKEMON_WIDTH, POKEMON_HEIGHT, true, true, "Image/Pokemon_Battle.png", _scene)
{

}

void Animations::SetPokemon(int _number, bool _isPlayer)
{
	if(_isPlayer)
		SetAnimation(1, 2, GetX(), GetY(), 0, POKEMON_HEIGHT * (_number - 1), POKEMON_WIDTH, POKEMON_HEIGHT, true, true);
	else
		SetAnimation(2, 2, GetX(), GetY(), POKEMON_WIDTH, POKEMON_HEIGHT * (_number - 1), POKEMON_WIDTH, POKEMON_HEIGHT, true, true);
}

void Animations::SetAttack(const AnimationData& _data)
{
	SetAnimation(_data.nbFrames, 4, m_PosX, m_PosY, _data.frameX, _data.frameY, _data.width, _data.height, false, _data.isHorizontal);
}

Animations::~Animations()
{
	
}